{% extends "base.html" %}

{% block title %}Sign up{% endblock %}

{% block primary-content %}
<span class="breadcrumbs"><a href="{% url index %}" title="Home">Home</a> &raquo; Signup</span>
<h2>Sign up for a free account</h2>
<p class="page-intro">Save your address, create a profile, comment on blog posts and reports, and get a personalized news feed.</p>
<div class="form-wrapper clearfix">
	<form id="register" class="simple-form" method="post">
		{% csrf_token %}
		<h3>Register Now</h3>
		<p>Your information will be kept private.</p>
		{% if form.errors.username %}
			{% ifequal form.errors.username|first "This username is already taken. Please choose another." %}
		<p class="error-message">{{ form.errors.username|first }}</p>
			{% endifequal %}
		{% else %}
			{% if form.non_field_errors %}
		<p class="error-message">Please type the same password in both password inputs.</p>
			{% else %}
				{% if form.errors %}
		<p class="error-message">Fields outlined in red are required.</p>
				{% endif %}
			{% endif %}
		{% endif %}
		<div class="form-item{% if form.username.errors %} error{% endif %}">
			<label for="id_username">Username</label>
			{{ form.username }}
		</div>      
		<div class="form-item{% if form.email.errors %} error{% endif %}">
			<label for="id_email">Email</label>
			{{ form.email }}
		</div>
		<div class="form-item{% if form.password1.errors or form.non_field_errors %} error{% endif %}">
			<label for="id_password1">Password</label>
			{{ form.password1 }}
		</div>
		<div class="form-item{% if form.password2.errors or form.non_field_errors %} error{% endif %}">
			<label for="id_password2">Confirm password</label>
			{{ form.password2 }}
		</div>
		<div class="form-input clear-left">
			<input class="button" type="submit" value="Register"/>
		</div>
	</form>
</div><!--end .form-wrapper-->
{% endblock %}

{% block secondary-content %}
  {% include "snippets/reports_and_news.html" %}
{% endblock %}

